<?php  
  function bang($model,$cot,$dong){
    $n=count($cot);
    $m=count($dong);
    
    $kq='<table id="tables">';  
    //for($i=-1;$i<$m;$i++){
    
  
    $kq=$kq. '<th></th>';
               
            
    foreach($cot as $c):
        $kq=$kq. '<th><b><font color="#CC0909">'.
                      $c.'</font></b></th>';
                  
   endforeach; 
  
    $i=0;   
    foreach ($dong as $d):
        $kq.='<tr>';
        
        
            $kq.='<td>'.$d.'</td>';
            for($j=0;$j<$n;$j++)
                  $kq=$kq. '<td><input type="text" name="data['.$model.']['.($i).']['.($j).']">
                      </input></td>';
        
                    
        $kq.='</tr>';
        
        $i++;
        
     endforeach;  
    //}
    
    $kq.='</table>';
    
    return $kq;
    
    
  }
?>